<!-- templates/register.html -->
<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Register</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8f9fa;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
        }

        form {
            background-color: #fff;
            border: 2px solid #007bff;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
            padding: 40px;
            width: 300px;
            text-align: center;
        }

        h2 {
            color: #007bff;
            margin-bottom: 20px;
        }

        label {
            display: inline-block;
            margin-bottom: 5px;
            color: #333;
            font-weight: bold;
            text-align: left;
            width: 100%;
        }

        input {
            width: 100%;
            padding: 10px;
            margin-bottom: 20px;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
        }

        button {
            background-color: #007bff;
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }

        button:hover {
            background-color: #0056b3;
        }

        p {
            color: #dc3545;
            margin-top: -10px;
        }

        .login-link {
            display: block;
            margin-top: 15px;
            color: #007bff;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <form method="post" action="{% url 'register' %}">
        {% csrf_token %}
        <h2>课程管理系统 - 注册</h2>
        <label for="user_number">账号:</label>
        <input type="text" id="user_number" name="user_number" required>
        <label for="user_name">姓名:</label>
        <input type="text" id="user_name" name="user_name" required>
        <label for="user_password">密码:</label>
        <input type="password" id="user_password" name="user_password" required>
        <label for="confirm_password">确认密码:</label>
        <input type="password" id="confirm_password" name="confirm_password" required>
        <p>{{ error_message }}</p>
        <button type="submit">注册</button>
        <a class="login-link" href="{% url 'login' %}">登录</a>
    </form>
</body>
</html>
